#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int main()
    {
        int n;
        cin >> n;
        n = n / 52 / 7;
        // 问题转化为 x + 3k = n 的解 (1 <= x <= 100)
        for (int i = min(100, n - 3); i >= 1; --i)
        {
            if ((n - i) % 3 == 0)
            {
                cout << i << endl
                     << (n - i) / 3;
                break;
            }
        }
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif